#include "../include/CDefaultPowerUpBehaviour.h"
#include "../include/CPlayerBehaviour.h"
#include "../include/CSprite.h"


//**************************
//Description : Constructor
//Parameters : Value for m_iX, m_iY,
//              m_iSpeedX, m_iSpeedY,
//              m_iWidth, m_Height,
//              the ratio for the collision box
//              m_iNbPoints
//Note : None
//**************************
CDefaultPowerUpBehaviour::CDefaultPowerUpBehaviour(int _iX, int _iY,
                                            int _iSpeedX , int _iSpeedY,
                                            int _iWidth, int _iHeight,
                                            float _fRatioW, float _fRatioH,
                                            int _iNbPoints)
    : IDefaultEntityBehaviour(_iX, _iY,
                            _iSpeedX, _iSpeedY,
                            _iWidth, _iHeight,
                            _fRatioW, _fRatioH,
                            AIR),
    m_iNbPoints(_iNbPoints)
{
}

//**************************
//Description : Copy Constructor
//Parameters : A CDefaultPowerUpBehaviour
//Note : None
//**************************
CDefaultPowerUpBehaviour::CDefaultPowerUpBehaviour(CDefaultPowerUpBehaviour & _DefaultPowerUp)
    : IDefaultEntityBehaviour(_DefaultPowerUp),
    m_iNbPoints(_DefaultPowerUp.m_iNbPoints)
{
}


//**************************
//Description : Destructor
//Parameters : None
//Note : None
//**************************
CDefaultPowerUpBehaviour::~CDefaultPowerUpBehaviour()
{
}

//**************************
//Description : Give a bonus (add life, new shot, etc...) to the entity
//Parameters : The entity which gain the bonus
//Return Value : None
//Note : We don't give a CPlayerBehaviour because... well it can be fun that we give it to an enemy
//       But for the time being, only Player will be give here
//**************************
void CDefaultPowerUpBehaviour::GiveBonus(CPlayerBehaviour * _Player)
{
    _Player->AddLife();
    _Player->AddPoints(m_iNbPoints);
}

//**************************
//Description : Update the trajectory of the entity
//Parameters : None
//Return Value : None
//Note : None
//**************************
void CDefaultPowerUpBehaviour::EntityTrajectory()
{
    m_iY++;
}
